<?php
    include_once('Configs/database.php');
    include_once('LopHocPhan.php');
    class NhatKiNhomTH extends database{
        private $manhomth;
        private $tongsotiet;
        private $tietdungkehoach;
        private $tietdaybu;
        private $tietkhongday;
        private $giaitrinh;
        private $nhanxetcuabm;
        private $daidiendv;
        private $nhanxetcuadv;
        private $daidienbm;
        public function setMaNhomTH($manhomth){
            $this->manhomth = $manhomth;
        }
        public function getMaNhomTH(){
            return $this->manhomth;
        }
        
        public function setNhanXetCuaBM($nhanxetcuabm){
            $this->nhanxetcuabm = $nhanxetcuabm;
        }
        public function getNhanXetCuaBM(){
            return $this->nhanxetcuabm;
        }
        
        public function setNhanXetCuaDV($nhanxetcuadv){
            $this->nhanxetcuadv = $nhanxetcuadv;
        }
        public function getNhanXetCuaDV(){
            return $this->nhanxetcuadv;
        }
        public function setGiaiTrinh($giaitrinh){
            $this->giaitrinh = $giaitrinh;
        }
        public function getGiaiTrinh(){
            return $this->giaitrinh;
        }
        
        public function setDaiDienBM($daidienbm){
            $this->daidienbm = $daidienbm;
        }
        public function getDaiDienBM(){
            return $this->daidienbm;
        }
        
        public function setDaiDienDV($daidiendv){
            $this->daidiendv = $daidiendv;
        }
        public function getDaiDienDV(){
            return $this->daidiendv;
        }
        
        public function thongTinNhatKiNhomTH(){
            $query = "select a.malophp,k.namhoc,k.hocki,a.manhomth,k.mahp,tenhp,sotc, a.maso,
						concat(holot, ' ', ten) as hoten , tenbm,tenkhoa,a.siso,sotietlithuyet,sotietthuchanh,
						(sotietlithuyet+sotietthuchanh) as tongsotiet,giaitrinh,nhanxetcuabm,nhanxetcuadv,daidienbm,daidiendv "; 
            $query .= "from NhomThucHanh a, CanBoGiangDay b, Bomon c, Khoa d,CanBo e,HocPhan f,NhatKiNhomTH g, LopHocPhan k ";
            $query .= "where a.manhomth = '".$this->getMaNhomTH()."' and a.maso = b.maso and b.mabm = c.mabm and c.makhoa=d.makhoa and b.maso = e.maso and f.mahp=k.mahp and a.manhomth=g.manhomth and a.malophp = k.malophp";
            
            $this->setQuery($query);
            //echo $this->getQuery();
            return $this->fetchAll();
        }
        public function ghiGiaiTrinh(){
            $query = "update NhatKiNhomTH set giaitrinh='".$this->getGiaiTrinh()."' where manhomth='".$this->getMaNhomTH()."' ";
            $this->setQuery($query);
            return $this->executeQuery();
        }
        public function ghiNhanXetCuaBM(){
            $query = "update NhatKiNhomTH set nhanxetcuabm='".$this->getNhanXetCuaBM()."',daidienbm='".$this->getDaiDienBM()."' where manhomth='".$this->getMaNhomTH()."' ";
            $this->setQuery($query);
            return $this->executeQuery();
        }
        
        public function ghiNhanXetCuaDV(){
            $query = "update NhatKiNhomTH set nhanxetcuadv='".$this->getNhanXetCuaDV()."',daidiendv='".$this->getDaiDienDV()."' where manhomth='".$this->getMaNhomTH()."' ";
            $this->setQuery($query);
            return $this->executeQuery();
        }
        
        
    }
?>